﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeFile="search.aspx.cs" Inherits="Default2" %>

<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxFormLayout" TagPrefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    <div style="float: left; margin-left: 10px; margin-top: 15px;">
        <div style="margin-left: 3px; margin-top: 3px;">
        <dx:ASPxComboBox ID="cbb_kontr" runat="server" ValueType="System.Int32" Width="198px" DataSourceID="ds_kontr" TextField="NAME" ValueField="CODE"></dx:ASPxComboBox>
            </div>
        <table>
            <tr>
                <td>
                    <dx:ASPxDateEdit ID="dt1" runat="server" HelpText="Период с" Width="97px">
                        <HelpTextSettings Position="Top">
                        </HelpTextSettings>
                    </dx:ASPxDateEdit>
                </td>
                <td>
                    <dx:ASPxDateEdit ID="dt2" runat="server" HelpText="Период по" Width="97px">
                        <HelpTextSettings Position="Top">
                        </HelpTextSettings>
                    </dx:ASPxDateEdit>
                </td>
            </tr>
        </table>
        <div style="margin-left: 2px">
            <dx:ASPxComboBox ID="cbb_DocType" runat="server" DataSourceID="ds_DocType"
                Width="198px"
                TextField="NAME" ValueField="CODE" ValueType="System.Int32" HelpText="тип документа">
                <HelpTextSettings Position="Top">
                </HelpTextSettings>
            </dx:ASPxComboBox>
        </div>
        <div style="margin-left: 2px; margin-top: 12px;">
            <dx:ASPxButton ID="btn_find" runat="server" OnClick="ASPxFormLayout1_E1_Click" Text="Найти" Width="198px" Theme="iOS">
            </dx:ASPxButton>
        </div>
        <hr />
        <div style="margin-left: 2px; margin-top: 2px;">
            <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="Поиск по номеру документа" Visible="False"></dx:ASPxLabel>
        </div>
        <div style="margin-left: 2px; margin-top: 2px;">
            <dx:ASPxTextBox ID="txt_DocNum" runat="server" Width="198px" HelpText="Поиск по номеру документа">
                <HelpTextSettings Position="Top">
                </HelpTextSettings>
            </dx:ASPxTextBox>
        </div>
        <div style="margin-left: 2px; margin-top: 12px;">
            <dx:ASPxButton ID="btn2" runat="server" OnClick="btn2_Click" Text="Найти" Width="198px" Theme="iOS">
            </dx:ASPxButton>
        </div>
    </div>
    <div style="  margin-left: 20px; margin-top: 8px; margin-right: 10px; padding-left: 10px;">
        <dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server">
            <Items>
                <dx:LayoutGroup Caption="Layout Group" ShowCaption="False">
                    <Items>
                        <dx:LayoutItem Caption="Layout Item" ShowCaption="False">
                            <LayoutItemNestedControlCollection>
                                <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                    <dx:ASPxGridView ID="grid" runat="server" AutoGenerateColumns="False" KeyFieldName="CODE" Width="100%" Theme="Default" OnPageIndexChanged="grid_PageIndexChanged" OnPageSizeChanged="grid_PageSizeChanged">
                                        <Columns>
                                            <dx:GridViewDataTextColumn FieldName="CODE" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="1">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="DOPDOG" ShowInCustomizationForm="True" Visible="False" VisibleIndex="2">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="Тип документа" FieldName="DOCTYPE" ShowInCustomizationForm="True" VisibleIndex="3" Width="100px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="Номер документа" FieldName="NOMER" ShowInCustomizationForm="True" VisibleIndex="4" Width="100px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataDateColumn Caption="Дата документа" FieldName="DATA" ShowInCustomizationForm="True" VisibleIndex="5" Width="100px">
                                            </dx:GridViewDataDateColumn>
                                            <dx:GridViewDataTextColumn Caption="Кол-во страниц" FieldName="PAGENUM" ShowInCustomizationForm="True" VisibleIndex="6" Width="100px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="Примечание" FieldName="NOTE" ShowInCustomizationForm="True" VisibleIndex="8" Width="100%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="ARCPLACE" ShowInCustomizationForm="True" Visible="False" VisibleIndex="9">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="STATE" ShowInCustomizationForm="True" Visible="False" VisibleIndex="7">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn ShowInCustomizationForm="True" VisibleIndex="0">
                                                 <EditFormSettings Visible="False" />
                                                 <DataItemTemplate>
                                                            <a href="Arh/docscan.aspx?dscod=<%# Eval("CODE") %>" style="color: #000000" target="_blank">сканкопии</a></DataItemTemplate>
                                            </dx:GridViewDataTextColumn>
                                        </Columns>
                                        <SettingsBehavior AllowSort="False" />
                                        <SettingsPager AlwaysShowPager="True" ShowSeparators="True">
                                            <PageSizeItemSettings Visible="True">
                                            </PageSizeItemSettings>
                                        </SettingsPager>
                                    </dx:ASPxGridView>
                                </dx:LayoutItemNestedControlContainer>
                            </LayoutItemNestedControlCollection>
                        </dx:LayoutItem>
                    </Items>
                </dx:LayoutGroup>
            </Items>
        </dx:ASPxFormLayout>
    </div>
    <asp:EntityDataSource ID="ds_DocType" runat="server" ConnectionString="name=RegistRar" DefaultContainerName="RegistRar"
        EnableFlattening="False" EntitySetName="DOCTYPE">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="ds_dogdoc" runat="server" ConnectionString="name=RegistRar" DefaultContainerName="RegistRar"
        EnableFlattening="False" EntitySetName="DOGDOC">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="ds_kontr" runat="server" ConnectionString="name=RegistRar" DefaultContainerName="RegistRar" EnableFlattening="False" EntitySetName="KONTRAGENT" OrderBy="it.[NAME]" Select="it.[CODE], it.[NAME]">
    </asp:EntityDataSource>
</asp:Content>


